/*
 * Dictionary.hh
 *
 *  Created on: 26/05/2010
 *      Author: prodrig
 */

#ifndef DICTIONARY_HH_
#define DICTIONARY_HH_

#include "IDictionary.h"
#include "IKey.h"
#include "ICollectible.h"
#include "ICollection.h"
#include "HashedKey.h"
#include <string>

using std::string;

class HashedDictionary: public IDictionary {
public:
	ICollectible **buckets;
	ICollection *keys;
	int bckSize;
	void initBuckets();
	int hash(HashedKey*);
public:
	HashedDictionary();
	HashedDictionary(int);
	virtual void add(IKey*, ICollectible*);
	virtual ICollectible* remove(IKey*);
	virtual bool member(IKey*);
	virtual ICollectible* find(IKey*);
	virtual bool isEmpty();
	virtual IIterator* getIterator();
	virtual int size();
	virtual string toString();
	virtual bool same(ICollectible *);
	virtual ~HashedDictionary();
};

#endif /* DICTIONARY_HH_ */
